package com.thoughtworks.yuyijq.generate.ui;

import com.intellij.ide.util.MemberChooser;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * User: yuyijq
 * Date: Oct 10, 2010
 * Time: 8:45:57 PM
 */
public class ChooseTemplatePanel extends JPanel {
    private MemberChooser chooser;
    private JComboBox comboBox;
    private JButton templatesButton;

    public void setChooser(MemberChooser chooser) {
        this.chooser = chooser;
    }

    public ChooseTemplatePanel() {
        super();
        initCompoents();
    }

    private void initCompoents() {
        templatesButton = new JButton("Templates");
        templatesButton.setMnemonic(83);

        this.comboBox = new JComboBox(new String[5]);
        templatesButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {

            }
        });

        add(templatesButton, "East");
        add(this.comboBox, "Center");
        this.comboBox.setSelectedItem(null);
        JLabel templatesLabel = new JLabel("Template: ");
        templatesLabel.setDisplayedMnemonic('T');
        templatesLabel.setLabelFor(this.comboBox);
        add(templatesLabel, "West");
    }
}